﻿package com.massiveProCreation.utils.loaders {	// IMPOrtS	import flash.display.Sprite;	import flash.events.Event;	import flash.net.URLLoader;	import flash.net.URLRequest;	import com.massiveProCreation.events.CustomEvent;	public class XMLLoaderImproved extends Sprite {		// VARIABLES		private var _xml:XML; // xml				public function XMLLoaderImproved () {			// this is the custom xml loader, very easy to use.		}		public function loadXml(xmlURL:String) {	// this function loads xml			var urlLoader:URLLoader = new URLLoader();			urlLoader.addEventListener(Event.COMPLETE, xmlLoaded, false, 0 , true);			urlLoader.load(new URLRequest(xmlURL));		}				private function xmlLoaded(e:Event):void {			_xml = new XML(e.target.data);			// assign the xml to the xml object and dispath event			dispatchEvent(new CustomEvent(CustomEvent.XML_LOADED, true, false));		}		public function getXML():XML{			return _xml;		}	}}